package cn.wolfcode.trip.app.controller;

import cn.wolfcode.trip.base.domain.Customize;
import cn.wolfcode.trip.base.service.ICustomizeService;
import cn.wolfcode.trip.base.util.JSONResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/customize")
public class CustomizeController {
    @Autowired
    ICustomizeService customizeService;

    @RequestMapping("save")
    public JSONResult update(Customize customize){
            JSONResult result = new JSONResult();
        try {
            customizeService.save(customize);
        } catch (Exception e) {
            result.mark(e.getMessage());
        }
        return result;
    }
    @RequestMapping("get")
    public Customize get(Long userId){

        return customizeService.get(userId);


    }
}
